package com.thenie.vo;

public enum RoomStatusEnum {
    /**
     *
     */
    IDLE(1, "空闲"),
    RESERVED(2, "已预定"),
    OCCUPIED(3, "已入住");

    private final int value;
    private final String label;

    RoomStatusEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    // 根据值获取对应的枚举项
    public static RoomStatusEnum getByValue(int value) {
        for (RoomStatusEnum status : RoomStatusEnum.values()) {
            if (status.value == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid RoomStatusEnum value: " + value);
    }
}
